/*
 * @Author: gy
 * @Date: 2019-12-17 09:57:18
 * @LastEditors  : wl
 * @LastEditTime : 2020-07-02 00:05:04
 */
import {
  // getAction
} from '@/api/manage'
// import { delete } from 'vue/types/umd';
export default {
  data() {
    return {
      treeDialogVisible: false,
      editCheckId: '', // 单选
      filterText: '',
      treeData: [], // tree树
      defaultProps: {
        children: 'children',
        label: 'name'
      },
      expanded: false, // 折叠打开
    }
  },
  created() {},
  mounted() {},
  methods: {
    // 过滤
    filterNode(value, data) {
      if (!value) return true;
      return data.name.indexOf(value) !== -1;
    },
    // 实现单选
    handleMetaNodeClick(item, node, self) {
      if(node === true) {
        this.editCheckId = item.id
        this.$refs['tree'].setCheckedKeys([item.id])
      } else {
        if(this.editCheckId === item.id) {
          this.$refs['tree'].setCheckedKeys([item.id])
        }
      }
    },
    nodeClick(item, node, self) {
      this.editCheckId = item.id
      this.$refs['tree'].setCheckedKeys([item.id])
    },
  }
}
